<?php

include_once("conn.php");

$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
$sex = $_POST["sex"];
$xuehao = $_POST["xuehao"];
$xingming = $_POST["xingming"];

$query = "insert into bbs_user(u_name,u_password,u_email,u_sex,u_xuehao,u_xingming) values('".$username."','".$password."','".$email."','".$sex."','".$xuehao."','".$xingming."');";

$result = mysql_query($query);

if($result)
{
	$query = "select * from bbs_user where u_name = '".$username."';";
	$result = mysql_query($query);
	while($user = mysql_fetch_array($result))
	{	
		$name = $user["u_name"];
		$sex = $user ["u_sex"];
		$email = $user["u_email"];
		$xuehao = $user["u_xuehao"];
		$xingming = $user["u_xingming"];
		

	}
	if($result)
	{
		$mima = "保密";
		echo "注册成功，您的注册信息为:";echo "<br />";

		echo "用户名:".$name;echo "<br />";
		echo "密码:".$mima;echo "<br />";
		echo "邮箱:".$email;echo "<br />";
		echo "学号:".$xuehao;echo "<br />";
		echo "姓名:".$xingming;echo "<br />";
	}
}

?>